﻿@model AlbumDetailsViewModel
@{
    Layout = "~/Views/Shared/PublicLayout.cshtml";
    ViewBag.Title = "אלבום - " + Model.Album.Title;
}
@section headElements{
    <link href="@Url.Content("~/Content/AlbumEditorView.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/tinyScrollbar.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/AlbumEditorView.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/EditSectionEditors.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.tinyscrollbar.min.js")" type="text/javascript"></script>
}
@Html.Hidden("AlbumId", Model.Album.AlbumId)
@Html.Hidden("AlbumStatusId", Model.Album.AlbumStatusId)
@Html.Hidden("AlbumLockStatusId", Model.Album.AlbumLockStatusId)
@Html.Hidden("FilmingDaysJSON")
<div id="extraDetails">
    <ul id="sideMenu">
        <li class="editors"><a href="@Url.Action("EditSectionEditors", new { id = Model.Album.OrderNum })">
        </a></li>
        <li class="passwords"><a href="@Url.Action("EditorsFile", new { id = Model.Album.AlbumId })">
        </a></li>
        <li class="filmingDays hidden"><a href=""></a></li>
        <li class="contract"><a href=""></a></li>
        <li class="printVersion hidden"><a href=""></a></li>
    </ul>
    <div class="extraDetailsContainer" id="FilmingDaysContainer">
        <div class="label big">
            ימי צילום:
        </div>
        <ul id="FilmingDays" class="value">
        </ul>
        <span id="noFilmingDays" class="value hidden">אין</span>
    </div>
    <div class="extraDetailsContainer">
        <div class="label">
            תאריך סיום הספר:
        </div>
        <div class="value">
            @Model.Album.DueDate
        </div>
    </div>
    <div class="topSpace">
    </div>
    <a href="@Url.Action("Logout", "Users")" id="logoutUser"></a>
    <div id="contractDialog" class="hidden">
        @if (String.IsNullOrEmpty(Model.Album.ContractFile))
        {
            <span>אין קובץ חוזה</span>
        }
        else
        {
            <a href="@Url.Content(Model.Album.ContractFile)" target="_blank" class="button">הצג
                חוזה</a>
        }
    </div>
    <div id="printVersionDialog" class="hidden">
        @if (Model.PrintVersions.Count > 0)
        {
            <table class="width100">
                <tr>
                    <th>
                        מספר גרסה
                    </th>
                    <th>
                        תאריך יצירה
                    </th>
                    <th>
                        קבצים
                    </th>
                </tr>
                @foreach (var printVersion in Model.PrintVersions)
                {
                    <tr>
                        <td>
                            @printVersion.VersionIdx
                        </td>
                        <td>
                            @printVersion.VersionDate
                        </td>
                        <td>
                            <a href="@Url.Content("~/" + printVersion.InnerPdfFilePath)" target="_blank">PDF אלבום</a>
                            | <a href="@Url.Content("~/" + printVersion.CoverPdfFilePath)" target="_blank">PDF כריכה</a>
                        </td>
                    </tr>
                }
            </table>
        }
        else
        {
            <span>אין גרסאות דפוס</span>
        }
    </div>
</div>
<div id="mainSection">
    <div id="albumDetailsContainer">
        <div id="albumDetails">
            <div id="albumTitle">
                @Model.Album.Title
            </div>
        </div>
        <div id="actionsContainer">
            <div id="albumStatusDesc">
                מצב נעילה:
                @Model.Album.AlbumLockStatus
                <br />
                סטטוס: @Model.Album.AlbumStatus
            </div>
            @{
                var AllowEditAlbum = false;
                if (Model.Album.AlbumLockStatusId != 1)
                {
                    AllowEditAlbum = true;
                }
            }
            <ul class="buttonsContainer">
                <li><a data-href="@Url.Action("Index", "Designer", new { AlbumId = Model.Album.AlbumId })" id="btnAlbumDesigner" title="עיצוב אלבום">
                </a></li>
                <li><a href="@Url.Action("UploadImages", "Albums", new { AlbumId = Model.Album.AlbumId })" class="btnUploadImages" title="העלאת תמונות">
                </a></li>
                <li><a href="@Url.Action("Index", "Designer", new { AlbumId = Model.Album.AlbumId, designerAction = "Preview" })" class="btnPreviewSection" title="תצוגה מקדימה">
                </a></li>
                <li><a href="" id="btnApproveAlbum" title="אישור אלבום"></a></li>
            </ul>
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="loadingImage">
    </div>
    <div id="scrollbarContainer">
        <div id="scrollbar">
            <div class="scrollbar">
                <div class="track">
                    <div class="thumb">
                        <div class="end">
                        </div>
                    </div>
                </div>
            </div>
            <div class="viewport">
                <div class="overview" id="scrollbarContent">
                    <ul id="Sections">
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div id="bottomLegend">
    </div>
</div>
<div class="clear">
</div>
<script id="sectionRowTemplate" type="text/x-jquery-tmpl">
    <li data-section-id="${AlbumSectionId}" data-status-id="${AlbumSectionStatusId}" data-lock-status-id="${AlbumSectionLockStatusId}">
        <div class="paper"></div>
        <div class="paperContent">
            <div class="isLocked locked${AlbumSectionLockStatusId}" title="סטטוס נעילה: ${AlbumSectionLockStatus}"></div>
            <div class="albumSectionTitle">
                ${SectionTitle}
            </div>
            <ul class="buttonsContainer">
                <li><a href="@Url.Action("Index", "Designer", new { AlbumId = Model.Album.AlbumId })&AlbumSectionId=${AlbumSectionId}" class="btnAlbumSectionDesigner" title="עיצוב מקטע"></a></li>
                <li><a href="@Url.Action("Index", "Designer", new { AlbumId = Model.Album.AlbumId, designerAction = "Preview" })&AlbumSectionId=${AlbumSectionId}" class="btnPreviewSection" title="תצוגה מקדימה"></a></li>
                <li><a class="btnApproveSection" href="" title="אישור מקטע"></a></li>
                <li class="hidden"><a class="btnOpenSection" href="" title="החזר לתלמיד"></a></li>
            </ul>
            <div class="hidden">
                @Html.DropDownList("AlbumSectionStatusId", Model.AlbumSectionStatusesList)
                @Html.DropDownList("AlbumSectionLockStatusId", Model.AlbumSectionLockStatusesList)
            </div>
        </div>
    </li>
</script>
<script id="filmingDayRowTemplate" type="text/x-jquery-tmpl">
    <li title="צלם: ${Photographer}">${DateVal}</li>
</script>
